#include<bits/stdc++.h>
using namespace std;

int main()
{
    int arr[8]={1,1,0,2,0,5,6,7};
    int i = 0;
    int j = 0;
    while(i!=sizeof(arr)/sizeof(arr[0]))
    {
        while(arr[j] != 0)
        {
            j++;
        }
        i=j+1;
        while(arr[i]==0)
        {
            i++;
        }
        int temp = arr[j];
        arr[j] = arr[i];
        arr[i] = temp;
        i++;
        j++;
    }
    for(j=0;j<=7;j++)
        {
            cout<<arr[j];
        }
}
